package emulator.unittest.hardware.nmos6502.commands;

import emulator.EmulatorException;
import emulator.hardware.nmos6502.Flags6502;
import emulator.hardware.nmos6502.commands.ASL;
import org.junit.Before;
import org.junit.Test;

public class ASLTest extends CommandTestBase {

	@Before
	public void setUp() throws Exception {
		command = new ASL();
	}
	
	@Test
	public void testASLFull() throws EmulatorException {
		for (int i = 0; i < 256; i++)
		{
			int op_post = i << 1;
			int flags_post = 0;
			if ((op_post & 0xff) == 0)	flags_post |= Flags6502.FLAG_ZERO;
			if ((op_post & 0xff) > 127)	flags_post |= Flags6502.FLAG_NEGATIVE;
			if (op_post > 255)	flags_post |= Flags6502.FLAG_CARRY;
			executeAndCheckCommandOnOperand(command, 0, i, flags_post, op_post&255);
		}
	}

}
